| Package | Version | Purpose | Used In |
|---|---|---|---|
| express | ^4.18.2 | Web framework, routing | server.js, all routes |
| pg + pg-pool | ^8.11.3 | PostgreSQL client + connection pool | database.js |
| redis | ^4.6.11 | Redis client for caching | rateLimiter, sessions |
| jsonwebtoken | ^9.0.2 | JWT sign/verify for auth | auth.js middleware |
| bcryptjs | ^2.4.3 | Password hashing | auth routes |
| helmet | ^7.1.0 | Security HTTP headers | server.js |
| cors | ^2.8.5 | Cross-origin resource sharing | server.js |
| express-rate-limit | ^7.1.5 | API + auth rate limiting | server.js |
| express-validator | ^7.0.1 | Request input validation | routes |
| multer | ^1.4.5-lts.1 | File upload handling (receipts, photos) | expenses.js, gps.js |
| nodemailer | ^6.9.7 | SMTP email sending | emailService.js |
| pdfkit | ^0.14.0 | PDF payslip generation | payslipPDF.js |
| razorpay | ^2.9.2 | Payment gateway for SaaS billing | billing.js |
| winston | ^3.11.0 | Structured logging | logger.js |
| sanitize-html | ^2.11.0 | XSS prevention, input sanitization | sanitize.js |
| compression | ^1.7.4 | Gzip response compression | server.js |
| uuid | ^9.0.1 | UUID generation | various routes |
| morgan | ^1.10.0 | HTTP request logging | server.js |
| dotenv | ^16.3.1 | Environment variable loading | server.js |
| Name | hr-erp-server |
| AMI | Ubuntu Server 22.04 LTS |
| Instance Type | t3.medium |
| vCPU | 2 |
| RAM | 4 GB |
| Storage | 25 GB gp3 |
| Public IP | YOUR_EC2_IP |
| Key Pair | your-server-key.pem |
| Type | Port | Source |
|---|---|---|
| SSH | 22 | My IP only |
| HTTP | 80 | Anywhere |
| HTTPS | 443 | Anywhere |
| 3000 (React) | 3000 | 127.0.0.1 only |
| 5000 (API) | 5000 | 127.0.0.1 only |
| 5432 (PG) | 5432 | 127.0.0.1 only |
| 6379 (Redis) | 6379 | 127.0.0.1 only |
| Docker Engine | Installed |
| Nginx | Installed |
| Certbot | Installed |
| python3-certbot-nginx | Installed |
| UFW Firewall | Enabled |
| systemd service | hr-erp.service |
| Docker group | ubuntu user added |
| Job | Time | Status | What it does |
|---|---|---|---|
| Lint | 38s | Passed | ESLint on all backend JS files |
| Security Scan | 1m 2s | Passed | Trivy + Gitleaks + npm audit |
| Tests | 1m 0s | Passed | Jest unit tests with live PostgreSQL + Redis |
| Docker Build & Push | 26s | Passed | Backend + Frontend images pushed to Docker Hub |
| Deploy to Production | 40s | Passed | SSH β git pull β docker compose up β migrations |
| Total Pipeline | ~3 min | All Green | From git push to live production |